package com.atguigu.lease.model.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.baomidou.mybatisplus.annotation.IEnum;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;

/**
 * @author LOGIN
 * @title ItemTypeEnum
 * @create 2025/6/23 18:25
 * @description
 */
@Schema(description = "公寓房间类型的枚举类")
@Getter
public enum ItemTypeEnum implements BaseTypeEnum {
    APARTMENT(1,"公寓"),
    ROOM(2,"房间")
    ;

    @Schema(description = "类型的code: 1  2")
    //表示当前对象  jackson转字符串时， 使用哪个属性
    @JsonValue
    @EnumValue //当枚举对象被mp的wrapper使用时，读取枚举对象的哪个属性值使用
    private Integer code;
    @Schema(description = "类型的名称: 公寓 , 房间")
    private String name;
    private ItemTypeEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }
}
